!! Copyright (C) 2012 The 2012 Benasque TDDFT School
!!
!! This program is free software; you can redistribute it and/or modify
!! it under the terms of the GNU General Public License as published by
!! the Free Software Foundation; either version 2, or (at your option)
!! any later version.
!!
!! This program is distributed in the hope that it will be useful,
!! but WITHOUT ANY WARRANTY; without even the implied warranty of
!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
!! GNU General Public License for more details.
!!
!! You should have received a copy of the GNU General Public License
!! along with this program; if not, write to the Free Software
!! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
!! 02111-1307, USA.

module mesh_init
    implicit none

    TYPE :: grid
        integer :: n
        real(8) :: delta, length
    END TYPE grid

    TYPE(grid) :: mesh_opt

contains

subroutine mesh_initialization(npoints, length)
    implicit none

    integer, intent(in) :: npoints
    real(8), intent(in) :: length

    mesh_opt%delta = length/(npoints-1)

    mesh_opt%n = npoints

    mesh_opt%length = length

end subroutine mesh_initialization

end module mesh_init
